package br.edu.ufcg.lsd.wbis.ui.client.ui;

import com.gwtext.client.widgets.Window;
import com.gwtext.client.widgets.event.ButtonListenerAdapter;

/**
 * @author Renato Miceli
 */
public class SubmitFormButtonListener<T> extends ButtonListenerAdapter {
	
	private final Window enclosingWindow;

	private final FormManager<T> formManager;
	
	public SubmitFormButtonListener(Window enclosingWindow, FormManager<T> formManager) {
		this.enclosingWindow = enclosingWindow;
		this.formManager = formManager;
	}
	
	public Window getEnclosingWindow() {
		return this.enclosingWindow;
	}
	
	public T getParsedInfo() {
		return this.formManager.parseForm();
	}

}
